package com.fixme4trade.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.validation.constraints.Size;

import com.fixme4trade.constant.CCType;

@Entity
public class CredictCard implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue	
	@Column(name="credict_card_id")
	private long id;

	@Enumerated
	private CCType type;

	@ManyToOne
	@JoinColumn(name="customer_id", nullable=false)	
	private Customer owner;

	@Size(max = 10)
	private String ccName;

	@Size(max = 2)
	private int expireMonth;

	@Size(max = 4)
	private int expireYear;

	@Size(max = 50)
	private int number;

	@Size(max = 3)
	private int cvv;

	public CredictCard() {

	}

	public CCType getType() {
		return type;
	}

	public void setType(CCType type) {
		this.type = type;
	}

	public Customer getOwner() {
		return owner;
	}

	public void setOwner(Customer owner) {
		this.owner = owner;
	}

	public String getCcName() {
		return ccName;
	}

	public void setCcName(String ccName) {
		this.ccName = ccName;
	}

	public int getExpireMonth() {
		return expireMonth;
	}

	public void setExpireMonth(int expireMonth) {
		this.expireMonth = expireMonth;
	}

	public int getExpireYear() {
		return expireYear;
	}

	public void setExpireYear(int expireYear) {
		this.expireYear = expireYear;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public int getCvv() {
		return cvv;
	}

	public void setCvv(int cvv) {
		this.cvv = cvv;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}	
}